/**
 * @Desc:
 * @Users: zouqihui
 * @Date: 2022/11/22 14:20
 */
package models

import (
	"github.com/beego/beego/v2/client/orm"
	_ "github.com/go-sql-driver/mysql"
)

// Model Struct
type Users struct {
	Id       int
	Username string `orm:"size(100)"`
}

func init() {
	orm.RegisterModel(new(Users))
}

func UserInfo(id int) (Users, error) {
	var (
		err error
	)

	o := orm.NewOrm()
	user := Users{Id: id}
	err = o.Read(&user)
	return user, err
}
